home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1998-08-17  |  7.5 KB  |  245 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Aliases.a
  3. ;
  4. ;    Contains:    Alias Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    Mac OS 8.1
  7. ;                Release:    Universal Interfaces 3.2
  8. ;
  9. ;    Copyright:    © 1989-1995, 1997-1998 by Apple Computer, Inc., all rights reserved
  10. ;
  11. ;    Bugs?:        For bug reports, consult the following page on
  12. ;                the World Wide Web:
  13. ;
  14. ;                    http://developer.apple.com/bugreporter/
  15. ;
  16. ;
  17.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  18. __ALIASES__ SET 1
  19.  
  20.     IF &TYPE('__MACTYPES__') = 'UNDEFINED' THEN
  21.     include 'MacTypes.a'
  22.     ENDIF
  23.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  24.     include 'AppleTalk.a'
  25.     ENDIF
  26.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  27.     include 'Files.a'
  28.     ENDIF
  29.  
  30.  
  31. rAliasType                        EQU        'alis'                ; Aliases are stored as resources of this type 
  32.  
  33.                                                             ; define alias resolution action rules mask 
  34. kARMMountVol                    EQU        $00000001            ; mount the volume automatically 
  35. kARMNoUI                        EQU        $00000002            ; no user interface allowed during resolution 
  36. kARMMultVols                    EQU        $00000008            ; search on multiple volumes 
  37. kARMSearch                        EQU        $00000100            ; search quickly 
  38. kARMSearchMore                    EQU        $00000200            ; search further 
  39. kARMSearchRelFirst                EQU        $00000400            ; search target on a relative path first 
  40.  
  41.                                                             ; define alias record information types 
  42. asiZoneName                        EQU        -3                    ; get zone name 
  43. asiServerName                    EQU        -2                    ; get server name 
  44. asiVolumeName                    EQU        -1                    ; get volume name 
  45. asiAliasName                    EQU        0                    ; get aliased file/folder/volume name 
  46. asiParentName                    EQU        1                    ; get parent folder name 
  47. ;  ResolveAliasFileWithMountFlags options 
  48.  
  49. kResolveAliasFileNoUI            EQU        $00000001            ; no user interaction during resolution 
  50. ;  define the alias record that will be the blackbox for the caller 
  51. AliasRecord                RECORD 0
  52. userType                 ds.l    1                ; offset: $0 (0)        ;  appl stored type like creator type 
  53. aliasSize                 ds.w    1                ; offset: $4 (4)        ;  alias record size in bytes, for appl usage 
  54. sizeof                     EQU *                    ; size:   $6 (6)
  55.                         ENDR
  56. ; typedef struct AliasRecord *            AliasPtr
  57.  
  58. ; typedef AliasPtr *                    AliasHandle
  59.  
  60. ;  alias record information type 
  61. ; typedef short                         AliasInfoType
  62.  
  63. ;   create a new alias between fromFile-target and return alias record handle  
  64. ;
  65. ; pascal OSErr NewAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle *alias)
  66. ;
  67.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  68.         Macro
  69.         _NewAlias
  70.             moveq               #2,D0
  71.             dc.w                $A823
  72.         EndM
  73.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  74.         IMPORT_CFM_FUNCTION NewAlias
  75.     ENDIF
  76.  
  77. ;  create a minimal new alias for a target and return alias record handle 
  78. ;
  79. ; pascal OSErr NewAliasMinimal(const FSSpec *target, AliasHandle *alias)
  80. ;
  81.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  82.         Macro
  83.         _NewAliasMinimal
  84.             moveq               #8,D0
  85.             dc.w                $A823
  86.         EndM
  87.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  88.         IMPORT_CFM_FUNCTION NewAliasMinimal
  89.     ENDIF
  90.  
  91. ;  create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  
  92. ;
  93. ; pascal OSErr NewAliasMinimalFromFullPath(short fullPathLength, const void *fullPath, ConstStr32Param zoneName, ConstStr31Param serverName, AliasHandle *alias)
  94. ;
  95.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  96.         Macro
  97.         _NewAliasMinimalFromFullPath
  98.             moveq               #9,D0
  99.             dc.w                $A823
  100.         EndM
  101.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  102.         IMPORT_CFM_FUNCTION NewAliasMinimalFromFullPath
  103.     ENDIF
  104.  
  105. ;  given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. 
  106. ;
  107. ; pascal OSErr ResolveAlias(ConstFSSpecPtr fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged)
  108. ;
  109.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  110.         Macro
  111.         _ResolveAlias
  112.             moveq               #3,D0
  113.             dc.w                $A823
  114.         EndM
  115.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  116.         IMPORT_CFM_FUNCTION ResolveAlias
  117.     ENDIF
  118.  
  119. ;  given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. 
  120. ;
  121. ; pascal OSErr GetAliasInfo(AliasHandle alias, AliasInfoType index, Str63 theString)
  122. ;
  123.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  124.         Macro
  125.         _GetAliasInfo
  126.             moveq               #7,D0
  127.             dc.w                $A823
  128.         EndM
  129.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  130.         IMPORT_CFM_FUNCTION GetAliasInfo
  131.     ENDIF
  132.  
  133.  
  134. ;
  135. ; pascal OSErr IsAliasFile(const FSSpec *fileFSSpec, Boolean *aliasFileFlag, Boolean *folderFlag)
  136. ;
  137.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  138.         Macro
  139.         _IsAliasFile
  140.             moveq               #42,D0
  141.             dc.w                $A823
  142.         EndM
  143.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  144.         IMPORT_CFM_FUNCTION IsAliasFile
  145.     ENDIF
  146.  
  147. ;
  148. ; pascal OSErr ResolveAliasWithMountFlags(const FSSpec *fromFile, AliasHandle alias, FSSpec *target, Boolean *wasChanged, unsigned long mountFlags)
  149. ;
  150.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  151.         Macro
  152.         _ResolveAliasWithMountFlags
  153.             moveq               #43,D0
  154.             dc.w                $A823
  155.         EndM
  156.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  157.         IMPORT_CFM_FUNCTION ResolveAliasWithMountFlags
  158.     ENDIF
  159.  
  160. ;  
  161. ;  Given a file spec, return target file spec if input file spec is an alias.
  162. ;  It resolves the entire alias chain or one step of the chain.  It returns
  163. ;  info about whether the target is a folder or file; and whether the input
  164. ;  file spec was an alias or not. 
  165. ;
  166.  
  167. ;
  168. ; pascal OSErr ResolveAliasFile(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased)
  169. ;
  170.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  171.         Macro
  172.         _ResolveAliasFile
  173.             moveq               #12,D0
  174.             dc.w                $A823
  175.         EndM
  176.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  177.         IMPORT_CFM_FUNCTION ResolveAliasFile
  178.     ENDIF
  179.  
  180.  
  181. ;
  182. ; pascal OSErr ResolveAliasFileWithMountFlags(FSSpec *theSpec, Boolean resolveAliasChains, Boolean *targetIsFolder, Boolean *wasAliased, unsigned long mountFlags)
  183. ;
  184.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  185.         Macro
  186.         _ResolveAliasFileWithMountFlags
  187.             moveq               #41,D0
  188.             dc.w                $A823
  189.         EndM
  190.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  191.         IMPORT_CFM_FUNCTION ResolveAliasFileWithMountFlags
  192.     ENDIF
  193.  
  194. ;
  195. ; pascal OSErr FollowFinderAlias(ConstFSSpecPtr fromFile, AliasHandle alias, Boolean logon, FSSpec *target, Boolean *wasChanged)
  196. ;
  197.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  198.         Macro
  199.         _FollowFinderAlias
  200.             moveq               #15,D0
  201.             dc.w                $A823
  202.         EndM
  203.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  204.         IMPORT_CFM_FUNCTION FollowFinderAlias
  205.     ENDIF
  206.  
  207. ;  
  208. ;   Low Level Routines 
  209. ;
  210.  
  211. ;  given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. 
  212. ;
  213. ; pascal OSErr UpdateAlias(ConstFSSpecPtr fromFile, const FSSpec *target, AliasHandle alias, Boolean *wasChanged)
  214. ;
  215.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  216.         Macro
  217.         _UpdateAlias
  218.             moveq               #6,D0
  219.             dc.w                $A823
  220.         EndM
  221.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  222.         IMPORT_CFM_FUNCTION UpdateAlias
  223.     ENDIF
  224.  
  225.  
  226.  
  227. ;   Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag 
  228. ;
  229. ; pascal OSErr MatchAlias(ConstFSSpecPtr fromFile, unsigned long rulesMask, AliasHandle alias, short *aliasCount, FSSpecArrayPtr aliasList, Boolean *needsUpdate, AliasFilterUPP aliasFilter, void *yourDataPtr)
  230. ;
  231.     IF TARGET_OS_MAC ** TARGET_CPU_68K ** ¬ TARGET_RT_MAC_CFM THEN
  232.         Macro
  233.         _MatchAlias
  234.             moveq               #5,D0
  235.             dc.w                $A823
  236.         EndM
  237.     ELSEIF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
  238.         IMPORT_CFM_FUNCTION MatchAlias
  239.     ENDIF
  240.  
  241.  
  242.  
  243.     ENDIF ; __ALIASES__ 
  244.  
  245.